import { DefaultLayout, ParentLayout } from '@/layout'
import type { Route } from '@/layout/components'

export default {
  path: '/marketing',
  name: 'Marketing',
  component: DefaultLayout,
  redirect: '/marketing/integralExchange/exchangeCommodity',
  meta: {
    title: '营销活动',
    icon: 'menu-game',
    alwaysShow: true,
    sort: 3,
    roles: ['营销活动']
  },
  children: [
    {
      path: 'integralExchange',
      name: 'IntegralExchange',
      component: ParentLayout,
      redirect: '/marketing/integralExchange/exchangeCommodity',
      meta: { title: '积分兑换', roles: ['积分兑换管理'] },
      children: [
        {
          path: 'exchangeCommodity',
          name: 'ExchangeCommodity',
          component: () =>
            import('@/views/marketing/integralExchange/exchangeCommodity'),
          meta: { title: '兑换商品', roles: ['积分兑换商品'] }
        },
        {
          path: 'exchangeRecord',
          name: 'ExchangeRecord',
          component: () =>
            import('@/views/marketing/integralExchange/exchangeRecord'),
          meta: { title: '兑换记录', roles: ['兑换记录'] }
        },
        {
          path: 'newGoodsRule',
          name: 'NewGoodsRule',
          component: () =>
            import('@/views/marketing/integralExchange/newGoodsRule'),
          meta: { title: '上新规则', roles: ['上新规则'] }
        },
        {
          path: 'commodityCreate',
          name: 'CommodityCreate',
          component: () =>
            import('@/views/marketing/integralExchange/commodityCreate'),
          meta: { title: '添加兑换商品', hidden: true }
        },
        {
          path: 'commodityEdit',
          name: 'CommodityEdit',
          component: () =>
            import('@/views/marketing/integralExchange/commodityEdit'),
          meta: { title: '编辑兑换商品', hidden: true }
        },
        {
          path: 'commodityDetail',
          name: 'CommodityDetail',
          component: () =>
            import('@/views/marketing/integralExchange/commodityDetail'),
          meta: { title: '商品详情', hidden: true }
        }
      ]
    },
    {
      path: 'signIn',
      name: 'SignIn',
      component: ParentLayout,
      meta: { title: '签到管理', roles: ['签到管理'] },
      children: [
        {
          path: 'signInConfig',
          name: 'SignInConfig',
          component: () => import('@/views/marketing/signIn/signInConfig'),
          meta: { title: '签到配置', roles: ['签到设置'], noCache: true }
        },
        {
          path: 'signInRecord',
          name: 'SignInRecord',
          component: () => import('@/views/marketing/signIn/signInRecord'),
          meta: { title: '签到记录', roles: ['签到记录'] }
        }
      ]
    },
    {
      path: 'unpack',
      name: 'Unpack',
      component: ParentLayout,
      meta: { title: '翻牌管理', roles: ['翻牌管理'] },
      children: [
        {
          path: 'unpackManage',
          name: 'UnpackManage',
          component: () => import('@/views/marketing/unpack/unpackManage'),
          meta: { title: '翻牌列表', roles: ['翻牌列表'] }
        },
        {
          path: 'unpackCreate',
          name: 'UnpackCreate',
          component: () => import('@/views/marketing/unpack/unpackCreate'),
          meta: { title: '新建翻牌', hidden: true }
        },
        {
          path: 'unpackEdit',
          name: 'UnpackEdit',
          component: () => import('@/views/marketing/unpack/unpackEdit'),
          meta: { title: '编辑翻牌', hidden: true }
        },
        {
          path: 'unpackResult',
          name: 'UnpackResult',
          component: () => import('@/views/marketing/unpack/unpackResult'),
          meta: { title: '翻牌结果', hidden: true }
        }
      ]
    },
    {
      path: 'group',
      name: 'Group',
      component: ParentLayout,
      meta: { title: '拼团管理', roles: ['拼团管理'] },
      children: [
        {
          path: 'groupManage',
          name: 'GroupManage',
          component: () => import('@/views/marketing/group/groupManage'),
          meta: { title: '拼团管理', roles: ['拼团管理'] }
        },
        {
          path: 'groupCreate',
          name: 'GroupCreate',
          component: () => import('@/views/marketing/group/groupCreate'),
          meta: { title: '新建拼团', hidden: true }
        },
        {
          path: 'groupEdit',
          name: 'GroupEdit',
          component: () => import('@/views/marketing/group/groupEdit'),
          meta: { title: '编辑拼团', hidden: true }
        },
        {
          path: 'groupView',
          name: 'GroupView',
          component: () => import('@/views/marketing/group/groupView'),
          meta: { title: '拼团详情', hidden: true }
        },
        {
          path: 'groupList',
          name: 'GroupList',
          component: () => import('@/views/marketing/group/groupList'),
          meta: { title: '拼团列表', roles: ['拼团列表'] }
        },
        {
          path: 'groupDetail',
          name: 'GroupDetail',
          component: () => import('@/views/marketing/group/groupDetail'),
          meta: { title: '拼团详情', hidden: true }
        },
        {
          path: 'groupConfig',
          name: 'GroupConfig',
          component: () => import('@/views/marketing/group/groupConfig'),
          meta: { title: '活动配置', roles: ['活动配置'] }
        }
      ]
    },
    {
      path: 'qActList',
      name: 'QActList',
      component: () => import('@/views/marketing/question'),
      meta: { title: '答题活动', roles: ['答题活动'] }
    },
    {
      path: 'qAddOrEditAct',
      name: 'QAddOrEditAct',
      component: () => import('@/views/marketing/question/createOrEditAct'),
      meta: { title: '活动设置', hidden: true }
    },
    {
      path: 'qResultDetail',
      name: 'QResultDetail',
      component: () => import('@/views/marketing/question/detail'),
      meta: { title: '答题数据', hidden: true }
    },

    {
      path: 'redPacketRain',
      name: 'RedPacketRain',
      component: () => import('@/views/marketing/redPacketRainConfig'),
      meta: { title: '红包雨配置', roles: ['红包雨配置'] }
    },
    {
      path: 'iconSetting',
      name: 'IconSetting',
      component: () => import('@/views/marketing/iconSetting'),
      meta: { title: '金刚区配置', roles: ['积分金刚区配置'] }
    },
    {
      path: 'yxGoodsManage',
      name: 'YxGoodsManage',
      component: () => import('@/views/marketing/yxGoodsManage'),
      meta: { title: '商品管理', roles: ['营销商品管理'] }
    },
    {
      path: 'yxEditGiftGoods',
      name: 'YxEditGiftGoods',
      component: () => import('@/views/marketing/yxGoodsManage/editGiftGoods'),
      meta: { title: '编辑商品', hidden: true }
    },
    {
      path: 'yxExpressTemplete',
      name: 'YxExpressTemplete',
      component: () => import('@/views/marketing/yxExpressTemplete'),
      meta: { title: '运费模板', roles: ['营销运费模板'] }
    },
    {
      path: 'yxOrderManage',
      name: 'YxOrderManage',
      component: ParentLayout,
      redirect: '/marketing/yxOrderManage/orderList',
      meta: { title: '订单管理', roles: ['营销订单管理'] },
      children: [
        {
          path: 'yxOrderList',
          name: 'YxOrderList',
          component: () => import('@/views/marketing/yxOrderManage/orderList'),
          meta: { title: '订单列表', roles: ['营销订单列表'] }
        },
        {
          path: 'yxRefundOrderList',
          name: 'YxRefundOrderList',
          component: () =>
            import('@/views/marketing/yxOrderManage/refundOrderList'),
          meta: { title: '售后订单', roles: ['营销售后订单'] }
        },
        {
          path: 'yxOrderDetail',
          name: 'YxOrderDetail',
          component: () =>
            import('@/views/marketing/yxOrderManage/orderList/orderDetail'),
          meta: { title: '订单详情', hidden: true }
        },
        {
          path: 'expressReplacement',
          name: 'ExpressReplacement',
          component: () =>
            import('@/views/marketing/yxOrderManage/expressReplacement'),
          meta: { title: '快递更换', roles: ['营销快递更换'] }
        },
        {
          path: 'expressDetail',
          name: 'ExpressDetail',
          component: () =>
            import(
              '@/views/marketing/yxOrderManage/expressReplacement/expressDetail'
            ),
          meta: { title: '快递更换查看详情', hidden: true }
        }
      ]
    },
    {
      path: 'reservation',
      name: 'Reservation',
      component: () => import('@/views/marketing/reservation/index'),
      meta: { title: '预约', roles: ['营销预约'] }
    }
  ]
} as Route
